package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Artist;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ArtistDao {
    @Insert("insert into artist(artistId,artistName,artistIconUrl,artistIntroduce,honor,`desc`,`index`,insertTime,updateTime,status) " +
            "values(#{artistId},#{artistName},#{artistIconUrl},#{artistIntroduce},#{honor},#{desc},#{index},#{insertTime},#{updateTime},#{status})")
    int insert(Artist artist);

    @Select("select * from artist order by updateTime")
    List<Artist> query();

    @Select("select * from artist where artistId=#{artistId}")
    Artist queryById(String artistId);

    @Select("select count(0) from art where artistId=#{id}")
    int queryCountArtById(String id);

    @Delete("delete from artist where artistId=#{id}")
    int delete(String id);
}
